package atguigu.thread.yuanzi;

import java.util.concurrent.atomic.AtomicInteger;

public class AtomicDemo {

	public static void main(String[] args) {
		AtomicInteger tom = new AtomicInteger(1);
		int incrementAndGet = tom.incrementAndGet();
		System.out.println(incrementAndGet);
		
		AtomicInteger tom1 = new AtomicInteger(1);
		int andIncrement = tom1.getAndIncrement();
		System.out.println(andIncrement);
		System.out.println(tom1.get());
		
	}
}
